import { HydratedDocument } from "mongoose";
import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose";

export type UserDocument = HydratedDocument<User>;

@Schema()
export class User {
  @Prop()
  name: string;

  @Prop()
  price: number;价格

  @Prop()
  stock: number;

  @Prop([String])
  tag: string;
}

export const UserSchema = SchemaFactory.createForClass(User);
